package com.stellar.circle.redis;


import lombok.Getter;

import java.util.concurrent.TimeUnit;

/**
 * redis缓存Key
 *
 * @Author Jqcc
 * @Version 1.0
 * @Data 2025/3/27
 */
@Getter
public enum RedisCacheKey {

    /**
     * 帖子置顶订单编号
     * 分布式流水号
     * KEY : pin_order_no:%s
     * VALUE : LY_PIN+日期+自增流水号 (LY_PIN20250328001)
     */
    PIN_ORDER_NO("pin_order_no:%s", 1L, TimeUnit.DAYS),

    /**
     * 帖子置顶缓存
     * 用于缓存需要置顶的帖子信息、开始/结束时间
     */
    POST_PIN("post:pin:", 1L, TimeUnit.DAYS),

    /**
     * 置顶延迟对列
     * 用于定时任务扫描 - 添加置顶
     */
    POST_PIN_QUEUE("post:pin:queue", 1L, TimeUnit.DAYS),

    /**
     * 置顶到期队列
     * 用于定时任务扫描 - 取消置顶
     */
    POST_PIN_EXPIRE_QUEUE("post:pin:expire", 1L, TimeUnit.DAYS);


    private String cachePrefix;

    private Long cacheTime;

    private TimeUnit cacheTimeUnit;

    RedisCacheKey(String cachePrefix, Long cacheTime, TimeUnit cacheTimeUnit) {
        this.cachePrefix = cachePrefix;
        this.cacheTime = cacheTime;
        this.cacheTimeUnit = cacheTimeUnit;
    }

    }
